package eliauk.fun.flowabledemo.listener.enterprise.approve;

import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;


/**
 * 企业内部审核结束监听器
 */
@Component("EnterpriseIntervalApproveListener")
@Slf4j
public class EnterpriseIntervalApproveListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution delegateExecution) {
        log.info("监听到了企业内部审核结束");
        Boolean checkResult = (Boolean) delegateExecution.getVariable("checkResult");
        if (checkResult) {
            log.info("审核通过");
        } else {
            log.info("审核不通过");
        }
    }
}
